import Mock, { MockjsRequestOptions } from 'mockjs'
import { printReq } from '../common'
const Random = Mock.Random

const status = ['已成交', '未成交']
export const customerListInImResponsible = (req: MockjsRequestOptions) => {
  const data = []
  for(let i = 0; i < 20; i++) {
    const obj = {
        briefName: Random.cword(2,4) + '科技',
        contactsAndTelephone: `${Random.cname()}:${Random.integer(10000000000,19999999999)}`,
        salesperson: Random.cname(),
        status: status[Random.integer(0,1)],
        contractQuantity: Random.integer(0,20),
        invoicesNumber: Random.integer(0,50),
        creator: Random.cname(),
        recordedAmount: `${Random.integer(0,10000000)}.00`
      }
    data.push(obj)
  }
  const res = {
    code: 200,
    message: '请求成功',
    data
  }
  return printReq(res, req)
}